package com.backstage.entity;

import com.backstage.common.base.validator.Add;
import com.backstage.common.base.validator.Other;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;
import java.util.ArrayList;
import java.util.List;

/**
 * @Project authority
 * @Package com.backstage
 * @Data 2017/7/11下午 1:38.
 * @Aurhor 阮雪峰
 */
public class User extends BaseEntity{
    public User() {}

    public User(String user_name, String password) {
        this.user_name = user_name;
        this.password = password;
    }

    private long uid;
    private String real_name;
    private int sex;

    @NotBlank(message = "用户名不能为空", groups = {Add.class})
    private String user_name;

    @NotBlank(message = "密码不能为空", groups = {Other.class})
    private String password;
    private String des_key;
    private int status;//1正常0禁用
    private String create_time;
    private long creator;
    private User user;
    private String is_super;
    private String update_time;
    private String memo;
    private String position;
    private String contact_way;

    private String verifyCode;

    private List<Role> roles = new ArrayList<>();

    @NotBlank(message = "旧密码不能为空", groups = {Other.class})
    String oldPassword;

    @NotBlank(message = "确认密码不能为空", groups = {Other.class})
    String rePassword;

    public long getUid() {
        return uid;
    }

    public void setUid(long uid) {
        this.uid = uid;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }

    public String getOldPassword() {
        return oldPassword;
    }

    public void setOldPassword(String oldPassword) {
        this.oldPassword = oldPassword;
    }

    public String getRePassword() {
        return rePassword;
    }

    public void setRePassword(String rePassword) {
        this.rePassword = rePassword;
    }

    public String getVerifyCode() {
        return verifyCode;
    }

    public void setVerifyCode(String verifyCode) {
        this.verifyCode = verifyCode;
    }

    public String getDes_key() {
        return des_key;
    }

    public void setDes_key(String des_key) {
        this.des_key = des_key;
    }

    public String getReal_name() {
        return real_name;
    }

    public void setReal_name(String real_name) {
        this.real_name = real_name;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public String getUser_name() {
        return user_name;
    }

    public void setUser_name(String user_name) {
        this.user_name = user_name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public long getCreator() {
        return creator;
    }

    public void setCreator(long creator) {
        this.creator = creator;
    }

    public String getIs_super() {
        return is_super;
    }

    public void setIs_super(String is_super) {
        this.is_super = is_super;
    }

    public String getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(String update_time) {
        this.update_time = update_time;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getContact_way() {
        return contact_way;
    }

    public void setContact_way(String contact_way) {
        this.contact_way = contact_way;
    }

    @Override
    public String toString() {
        return "user";
    }
}
